<#--
    List of variables to be passed for this template:
        - PersistenceUnitName: String containing the persistance unit name.
        - ConnectionString: String containing the connection properties.
            Example: "jdbc:mysql://localhost:3306/NanoSNFramework_Polls"
        - UserName: database username.
        - Password: database password.
        - JDBCdriver: "com.mysql.jdbc.Driver"

-->
<@pp.dropOutputFile />
<@pp.changeOutputFile name="persistence.xml" /><?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
  <persistence-unit name="${PersistenceUnitName}" transaction-type="RESOURCE_LOCAL">
    <provider>oracle.toplink.essentials.PersistenceProvider</provider>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <properties>
      <property name="toplink.jdbc.url" value="${ConnectionString}"/>
      <property name="toplink.jdbc.driver" value="${JDBCdriver}"/>
      <property name="toplink.jdbc.user" value="${UserName}"/>
      <property name="toplink.jdbc.password" value="${Password}"/>
    </properties>
  </persistence-unit>
  <persistence-unit name="Schema-${PersistenceUnitName}" transaction-type="RESOURCE_LOCAL">
    <provider>oracle.toplink.essentials.PersistenceProvider</provider>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <properties>
      <property name="toplink.jdbc.url" value="${ConnectionString}"/>
      <property name="toplink.jdbc.driver" value="${JDBCdriver}"/>
      <property name="toplink.jdbc.user" value="${UserName}"/>
      <property name="toplink.jdbc.password" value="${Password}"/>
      <property name="toplink.ddl-generation" value="drop-and-create-tables"/>
      <property name="toplink.create-ddl-jdbc-file-name" value="sql/create-ddl.sql"/>
      <property name="toplink.drop-ddl-jdbc-file-name" value="sql/drop-ddl.sql"/>
      <property name="toplink.ddl-generation.output-mode" value="sql-script"/>
    </properties>
  </persistence-unit>
</persistence>
